import { GetServerSideProps, NextPage, PageConfig } from 'next';
import Head from 'next/head';
import Content from './content';
import getallgroups from './getallgroups';

interface IProps {
	data: ITbfdgroup[]
}

/**
 * 组别维护
 */
const Page: NextPage<IProps> = ({ data }) => {
	return (
		<>
			<Head>
				<title>组别维护</title>
			</Head>
			<Content initialdata={data} />
		</>
	);
};

export const config: PageConfig = {
	amp: false
};

export default Page;

export const getServerSideProps: GetServerSideProps<IProps> = async (context) => {
	const data = await getallgroups();
	return {
		props: {
			data
		}
	};
};
